{% extends "pretixcontrol/admin/base.html" %}
{% load i18n %}
{% load formset_tags %}

{% block video_admin_content %}
<h1 class="page-header">{% trans "Sync conftool posters" %}</h1>

{% if "task_id" in request.GET %}
    <div class="messages">
        {% if task_state == "SUCCESS" %}
            <div class="alert alert-success">{% trans "Completed." %}</div>
        {% elif task_state == "FAILURE" %}
            <div class="alert alert-danger">{% trans "Failed." %}<br>{{ task.result }}</div>
        {% elif task_state == "STARTED" %}
            <div class="alert alert-info">{% trans "Task is running." %}</div>
            <meta http-equiv="refresh" content="1">
        {% elif task_state == "PENDING" %}
            <div class="alert alert-info">{% trans "Task is waiting to start." %}</div>
            <meta http-equiv="refresh" content="1">
        {% else %}
            <div class="alert alert-danger">{{ task_state }}</div>
        {% endif %}
    </div>
{% else %}
    <form method="post" class="form-horizontal">
        {% csrf_token %}
        <div class="form-body">{{ form.as_p }}</div>
        <div class="video-admin-btn-row">
            <button type="submit" class="btn btn-primary">
                <span class="fa fa-refresh"></span> {% trans "Sync" %}
            </button>
            <a href="{% url 'eventyay_admin:video_admin:systemlog.list' %}" class="btn btn-default">{% trans "Back" %}</a>
        </div>
    </form>
{% endif %}
{% endblock %}
